#ifndef LOGGER_H_
#define LOGGER_H_

#include <stdio.h>
#include "env.h"
#include "message_queue.h"

enum {
	LOGGER_ERROR = -1,
	LOGGER_SUCCESS = 0
};

typedef struct logger_s {
	FILE* file;
	mq mq;
	thread_t write_thread;
	int run_flag;
	int seq;
} logger_t;

int logger_init(logger_t* l, const char* file);

int logger_add_message(logger_t* l, int id, char* message);

int logger_destroy(logger_t* l);

#endif /* LOGGER_H_ */

